import { defineConfig } from 'vite'

// 自动按需导入配置
// import AutoImport from 'unplugin-auto-import/vite'
// import Components from 'unplugin-vue-components/vite'
// import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

// 手动按需导入
import ElementPlus from 'unplugin-element-plus/vite'

import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),

    // Element-plus 自动按需导入
    // AutoImport({
    //   resolvers: [ElementPlusResolver()],
    // }),
    // Components({
    //   resolvers: [ElementPlusResolver()],
    // }),

    // Element-plus 手动按需导入
    ElementPlus()
  ],
  // resolve添加别名
  resolve: {
    alias: [
      {
        find: '@',
        replacement: '/src'
      }
    ]
  }
})
